const mongoose = require("mongoose");
const carSchame = new mongoose.Schema({
    catID: { type: String },//车牌
    headImg: { type: String },
    fgpImg: { type: String },
    fID: {
        type: String,
        unique: true,
        // set(Val) {
        //     return Val + Number(new Date()).toString().slice(5, -3) + Math.floor(Math.random() * 1000)
        // }
    },
    paperCard: { type: String },
    name: { type: String }, //姓名
    paper: { type: String }, //证件号
    limitedDate: { type: String },//有限期
    addres: { type: String },//地址
    IDimgZ: { type: String },//身份证
    IDimgF: { type: String },
    XSimgZ: { type: String },//行驶证正本
    XSimgF: { type: String },
    CZimgZ: { type: String },//车辆登记证书
    CZimgF: { type: String },
    phone: { type: String },
    YYimgZ: { type: String },//企业营业执行照（三合一）
    HZOimgZ: { type: String },//护照
    HZTimgZ: { type: String },
    HZFimgZ: { type: String },
    GAimgZ: { type: String },//港澳台通行证
    GAimgF: { type: String },
    FJimg: [{ type: String }],//附件
    logs: [
        {
            user: { type: mongoose.SchemaTypes.ObjectId, ref: 'User' },
            date: { type: String }
        },
    ]   //操作人
}, { timestamps: { createdAt: 'created', updatedAt: 'updated' } })
module.exports = mongoose.model("Cat", carSchame)